import request from '@/utils/request'

// 获取通知列表
export function getNotificationList(params) {
  return request({
    url: '/admin/notifications',
    method: 'get',
    params
  })
}

// 创建系统通知
export function createNotification(data) {
  return request({
    url: '/admin/notifications',
    method: 'post',
    data
  })
}

// 更新通知
export function updateNotification(id, data) {
  return request({
    url: `/admin/notifications/${id}`,
    method: 'put',
    data
  })
}

// 删除通知
export function deleteNotification(id) {
  return request({
    url: `/admin/notifications/${id}`,
    method: 'delete'
  })
}

// 发送通知
export function sendNotification(id) {
  return request({
    url: `/admin/notifications/${id}/send`,
    method: 'post'
  })
}

// 获取通知详情
export function getNotificationDetail(id) {
  return request({
    url: `/admin/notifications/${id}`,
    method: 'get'
  })
}

// 批量发送通知
export function batchSendNotifications(ids) {
  return request({
    url: '/admin/notifications/batch-send',
    method: 'post',
    data: { ids }
  })
}

// 获取通知统计
export function getNotificationStats() {
  return request({
    url: '/admin/notifications/stats',
    method: 'get'
  })
}

